package com.jrx.anytxn.investor.timer.job.noticeRouteResult.step;

import com.jrx.anytxn.investor.entity.TlFundRouteLog;
import com.jrx.anytxn.investor.mapper.ext.ExtTlFundRouteLogMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.batch.item.ItemWriter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 资金源路由通知 - writer
 *
 * @author liuyang
 * @date 2020-06-05
 */
@Service
public class InvestorNoticeRouteResultWriter implements ItemWriter<TlFundRouteLog> {

    @Resource
    private ExtTlFundRouteLogMapper fundRouteLogMapper;

    public void write(List<? extends TlFundRouteLog> items) {
        if (CollectionUtils.isNotEmpty(items)) {
            fundRouteLogMapper.batchUpdateForBatch((List<TlFundRouteLog>) items);
        }
    }
}
